package com.zhixun.zhlq.utils;


import com.zhixun.zhlq.entity.SysUserEntity;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

public class ShiroUtils {
    public static Subject getSubject() {
        return SecurityUtils.getSubject();
    }
    public static SysUserEntity getUser() {
        Object object = getSubject().getPrincipal();
        return (SysUserEntity)object;
    }
    public static Long getUserId() {
        return getUser().getId();
    }

}
